<?php

if (!defined('BASEPATH'))
     exit('No direct script access allowed');

class Topik_model extends CI_Model {

     //melakukan load database apabila kelas ini dipanggil
     function __construct() {
          parent:: __construct();
          $this->load->database();
     }

     function table_kasus() {
          $this->db->select('*');
          $this->db->from('data_kasus');
     }

     function get($limit = array()) {
          if ($limit == NULL)
               return $this->db->get('data_kasus')->result();
          else
               return $this->db->limit($limit['perpage'], $limit['offset'])->get('data_kasus')->result();
     }

     function count_baris() {
          $this->db->select('*');
          $this->db->from('data_kasus');
          return $this->db->count_all_results();
     }

}
